import request from '@/utils/request'
import { requestPath } from '@/utils/global.js'

export function getVipAPI() { //获取vip服务
    return request({
        url: `${requestPath.member1}/vip/page`,
        method: 'get',
    })
}


export function getOrderAPI(params) { //我的订单列表
    return request({
        url: `${requestPath.order}/order/page`,
        method: 'get',
        params
    })
}

export function orderDetAPI(params) { //我的订单详情
    return request({
        url: `${requestPath.order}/order/${params}`,
        method: 'get'
    })
}

export function createOrderAPI(data) { //创建订单
    return request({
        url: `${requestPath.order}/order/create-order`,
        method: 'post',
        data
    })
}

export function wxPayAPI(data) { //会员支付
    return request({
        url: `${requestPath.order}/order/create-vip-order`,
        method: 'post',
        data
    })
}

export function getOpenidAPI(params) { //获取openId
    return request({
        url: `third/wechat-wap-login/query/openid`,
        method: 'get',
        params
    })
}

export function isPayCoursementAPI(params) { //判断订单是否支付成功
    return request({
        url: `${requestPath.order}/order/check-is-paid`,
        method: 'get',
        params
    })
}

export function orderCountAPI(params) { //统计订单总数量 
    return request({
        url: `${requestPath.order}/order/count`,
        method: 'get',
        params
    })
}

export function getOrderDetAPI(params) { //获取订单详情
    return request({
        url: `${requestPath.order}/order/${params}`,
        method: 'get'
    })
}

export function resourcePayAPI(params) { //资源微信支付
    return request({
        url: `${requestPath.order}/order/pay`,
        method: 'get',
        params
    })
}